package com.cloudpivot.receivales.ding.config;

import com.cloudpivot.receivales.ding.robot.controller.StartRunnerController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * 钉钉相关 自动服务
 */
@Slf4j
@Configuration
@EnableScheduling
public class DingCronJob {

    @Autowired
    private StartRunnerController startRunnerController;
    /**
     * 定期更新 知识库信息
     */
    @Scheduled(cron = "0 30 23 ? * *")
    private void updateWorkSpaceMap() {
        startRunnerController.updateWorkspaceMapping();
    }
}
